import request from "@/utils/request"

export const getList = (dsp: any) => {
  return request("/syncbaseconfig/list", "GET", dsp)
}

export const deleteOne = (id: number) => {
  return request("/syncbaseconfig/delete/" + id, "GET", {})
}

export const loadStatus = (id: number) => {
  return request("/syncbaseconfig/loadStatus/" + id, "GET", {})
}

export const unloadStatus = (id: number) => {
  return request("/syncbaseconfig/unloadStatus/" + id, "GET", {})
}

export const submitData = (dsp: any) => {
  if (dsp.id) {
    return request("/syncbaseconfig/edit", "POST", dsp)
  }
  return request("/syncbaseconfig/add", "POST", dsp)
}

export const getOne = (id: number) => {
  return request("/syncbaseconfig/detail", "GET", { id: id })
}

export const getFields = (id: number) => {
  return request("/syncbaseconfig/getFields/" + id, "GET", { id: id })
}

export const getDataSourcesList = () => {
  return request("/syncbaseconfig/getDataSourcesList", "GET", {})
}
